home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / drdtips.zip / 1115.TXT < prev    next >
Text File  |  1992-04-13  |  4KB  |  100 lines

  1. Document 1115
  2. SID and DEBUG Script
  3. 04/13/92
  4. BK
  5.  
  6.                       SID AND THE DEBUG SCRIPT
  7.  
  8.         Below is a generic listing of a typical DEBUG script that one
  9. can often find on BBS's or in magazines that will create some nice
  10. little utility file using the command:
  11.  
  12.         DEBUG < filename.ext
  13.  
  14.          What follows are the steps that one would use to adjust a
  15. script so that DR DOS 6.0's SID utility will produce the same file
  16. using the command:
  17.  
  18.         SID < filename.ext
  19.  
  20.         These scripts will usually follow a pattern. They will first
  21. establish the name of the file. SID does not require the name of the file
  22. until it is actually saved at the end. Then they will use the 'A' command
  23. to start assembling the instruction. DEBUG defaults to an offset of 100.
  24. In SID, one specifies that assembly should begin at offset 100 by the
  25. A100 command. Then the instructions for the utility itself are listed.
  26. These instructions should be identical under both DEBUG and SID. Finaly,
  27. DEBUG is told how many bytes of information to save using the RCX command.
  28.  
  29.         When one saves the file using SID, one specifies what the
  30. beginning and ending addresses should be. The beginning address is 100.
  31. The ending address is 100 + the number of bytes to be saved - 1 (In
  32. the example below, the ending address is represented by the word END).
  33. Since the arithmetic is in hexadecimal values, one may want to use the
  34. H command in SID to do the calculations (See the HEX NOTE below). The
  35. last command is to quit. It is the same under both utilities.
  36.  
  37. GENERIC SCRIPT
  38.  
  39. DEBUG SCRIPT    SID SCRIPT              COMMENTS
  40. -----------------------------------------------------------------------
  41. N filename.ext  (not required)         -SID uses file name when it is saved.
  42. A               A100        ---------+ -Begin assembling instructions.
  43. (instructions   (instructions        | -Use the original commands.
  44. go              go                   |
  45. here)           here)                |
  46.                                      |
  47. <CR>            <CR>                 | -<CR> to exit assembling
  48. RCX             (not required)       | -DEBUG is preparing to save y bytes
  49. y               (not required)       |   of data. +----------------+
  50. W               Wfilename.ext,100,END| -SID writes|from offset 100 to END
  51.                                      |    ( 100 + y - 1 = END )
  52.                                      |       |
  53.                                      +-------+
  54. Q               Q                       -And Quit.
  55.  
  56.  
  57. Below is an example of a script that will build BEEP.COM, a program
  58. that simply beeps the speaker once. Notice again that the arithmetic is in
  59. hexadecimal. (If that is something with which you are unfamilure, see the
  60. HEX NOTE at the end of this example.)
  61.  
  62.  
  63. DEBUG SCRIPT    SID SCRIPT      COMMENTS
  64. -----------------------------------------------------------------------
  65. N BEEP.COM      (not required)          SID saves file name at end
  66. A               A100        --------+   Begin assembling instructions
  67. MOV AH,2        MOV AH,2            |   Use the original commands
  68. MOV DL,07       MOV DL,07           |
  69. INT 21          INT 21              |
  70. MOV AH,4C       MOV AH,4C           |
  71. INT 21          INT 21              |
  72. <CR>            <CR>                |   <CR> to exit assembling
  73. RCX             (not required)      |   DEBUG is preparing to save 10 (A Hex)
  74. A               (not required)      |   of data.  +----------------+
  75. W               WKEYD.COM,100,109   |   SID writes|from offset 100 to 109
  76. Q               Q                   |     ( 100 + A - 1 = 109 )
  77.                                     |        |
  78.                                     +--------+
  79.  
  80.  
  81. HEX NOTE:       SID can do the hex math for you. In the above example,
  82.                 to do the first addition ( 100 + A ), load SID and type
  83.  
  84.                 H100 A
  85.  
  86.                 SID will respond:
  87.  
  88.                 + 010A   - 00F6   * 00000A00   / 0019 (0006)
  89.  
  90.                 The first value, 010A, is the sum. Use that value in the
  91.                 next command:
  92.  
  93.                 H10A 1
  94.  
  95.                 SID will respond:
  96.  
  97.                 + 010B   - 0109   * 0000010A   / 010A (0000)
  98.  
  99.                 The second value, 0109, is the END value you want to use.
  100.